package com.njupt.webapp.tags;

import javax.servlet.jsp.tagext.TagSupport;

import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

@SuppressWarnings("serial")
public abstract class ApplicationContextTag extends TagSupport {
	protected WebApplicationContext getContext(){
		return WebApplicationContextUtils.getWebApplicationContext(pageContext.getServletContext());
	}
	protected Object getBean(String beanName){
		return getContext().getBean(beanName);
	}
}
